var alldata='';
requetData();
function requetData() {
    $.ajax({
        url:"/publishgame/selectByUserId",
        dataType:"json",
        type:"post",
        success:function (data) {
            console.log(data)
            showData(data)
            alldata= data
        }
    })
}

function  showData(jsonObj) {

    var html = ' <tr><th></th><th>游戏名称</th><th>价格</th><th></th></tr>'

    for(var i = 0; i < jsonObj.length; i ++) {
        console.info(jsonObj[i].gameIntroduction)
        html = html + "<tr><td>"
        html = html +"<img src='" + jsonObj[i].gamePicture + "' ></img>"
        html = html + "</td><td>"
        html = html + jsonObj[i].gameName
        html = html + "</td><td>"
        html = html + jsonObj[i].gamePrice
        html = html + "</td>"
        html = html + "<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a type='button' class=\"btnv6_blue_hoverfade  btn btn-primary\" " +
            "href='publishgame/transmitgame?gameId=" + jsonObj[i].gameId +
            "'> <font  color=white>更新</font></a>&nbsp; " +
            "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a type='button' class=\"btnv6_blue_hoverfade  btn btn-primary\" href='publishgame/deletegame?gameId=" + jsonObj[i].gameId +"'><font  color=white>下架</font></button></td>"
        html = html + "</tr>"
    }

    $('.table').html(html)
}



